//
// Created by DELL on 2022/3/22.
//

#include <iostream>

using namespace std;

bool Isnum(int x) {
    for (int i = 2; i <= (x / 2); i++) {
        if ((x % i) == 0) {
            return false;
        }
    }
    return true;
}


void run() {
    int M, N;
    cin >> M >> N;

    int num[N];
    int tmp = 2;
    int index = 0;

    while (index != N) {
        if (Isnum(tmp)) {
            num[index] = tmp;
            index++;
        }
        tmp++;
    }

    tmp = (N - M + 1) / 10;
    index = (N - M + 1) % 10;

    for (int i = 0; i < tmp; i++) {
        string str = "";
        for (int j = 0; j < 10; j++) {
            str += (to_string(num[i * 10 + j + M - 1]) + " ");
        }
        cout << str.substr(0, str.length() - 1) << endl;
    }

    string str = "";

    for (int i = N - index; i < N; i++) {
        str += (to_string(num[i]) + " ");
    }
    cout << str.substr(0, str.length() - 1) << endl;
}

int main() {
    run();
    return 0;
}
